//
//  PersonViewController.m
//  TestProject6
//
//  Created by JasonLee on 14/12/11.
//  Copyright (c) 2014年 JasonLee. All rights reserved.
//

#import "PersonViewController.h"
#import "PersonDetailViewController.h"
#import "PersonPhoneViewController.h"
#import "PersonOrderListViewController.h"
#import "ProtocolManager.h"
#import "SettingViewController.h"
#import "UIImageView+LBBlurredImage.h"
#import "FeedbackViewController.h"
#import "TransforController.h"
#import "PersonCouponListViewController.h"
#import "EmptyViewController.h"
#import "CollectionListViewController.h"
#import "PersonManagerViewController.h"
#import "PersonOKListViewController.h"
#import "CollectionMenuMainViewController.h"

#define LOGINSTATUS @"loginStatus.plst"

@interface PersonViewController () <UITableViewDataSource, UITableViewDelegate, UIAlertViewDelegate, updateSuccessDelegate>{
    CGRect screenRect;
    CGSize screenSize;
    CGFloat width;
    UITableViewCell *mobileBindingCell;
    UIImageView *imgView;
    UITapGestureRecognizer *_imgTapGestureRecognizer;
    UIView *_headerView;
    //下拉菜单
    UIActionSheet *myActionSheet;
    //图片2进制路径
    NSString* filePath;
    UILabel *nick_name;
    UITableViewCell *cell_orders;
    UITableViewCell *cell_coupons;
    
    NSDictionary *dic_dataOfUser;
}

@end

@implementation PersonViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    NSLog(@"Loading PersonViewController;");
    
   // [self initData];
    [self setGesture];
    [self initView];
    [self getUserInfo];
    //[self.navigationController.navigationBar setAlpha:0.6];
    
    //self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"我的资料" style:UIBarButtonItemStyleDone target:self action:@selector(gotoPersonDetailViewController)];
    screenRect = [UIScreen mainScreen].bounds;
    screenSize = screenRect.size;
    width = screenSize.width;
    
    _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, width, screenSize.height - (HEIGHT_STATUS_BAR + HEIGHT_BOTTOM_BAR)) style:UITableViewStyleGrouped];
    //_tableView = [[UITableView alloc]initWithFrame:screenRect style:UITableViewStylePlain];
    _tableView.tableHeaderView = _headerView;
    _tableView.tableFooterView = [[UIView alloc]init];
    //_tableView.scrollEnabled = NO;
    _tableView.dataSource = self;
    _tableView.delegate = self;
    [self.view addSubview:_tableView];

}

- (void)initView {
    NSArray* nibView =  [[NSBundle mainBundle] loadNibNamed:@"PersonView" owner:nil options:nil];
    _headerView = [nibView objectAtIndex:0];
    UIImageView *imageView = (UIImageView *)[_headerView viewWithTag:90001];
    [imageView setFrame:CGRectMake(0, -45, 320, 245)];
    [imageView setImageToBlur:imageView.image
                 blurRadius:kLBBlurredImageDefaultBlurRadius
            completionBlock:^(NSError *error){
                NSLog(@"The blurred image has been setted");
            }];
    [_headerView setFrame:CGRectMake(0, 0, 320, 200)];
    UIView *tempView = [_headerView viewWithTag:90002];
    if ([tempView isKindOfClass:[UIImageView class]]) {
        imgView = (UIImageView *)tempView;
    }
    imgView.layer.masksToBounds = YES;
    imgView.layer.cornerRadius = 30;
    [imgView setContentMode:UIViewContentModeScaleToFill];
    imgView.userInteractionEnabled = YES;
//    [imgView addGestureRecognizer:_imgTapGestureRecognizer];
//    UILabel *pointView = (UILabel *)[_headerView viewWithTag:90005];
//    pointView.text = @"0";
    nick_name = (UILabel *)[_headerView viewWithTag:90003];
//    NSString *_nick_name = [[NSString alloc]initWithFormat:@"%@",[[NSUserDefaults standardUserDefaults]objectForKey:@"Username"]];
//    nick_name.text = _nick_name;
    [self reloadData];
    nick_name.font = [UIFont fontWithName:@"TrebuchetMS-Bold" size:16];
    UIButton *btn_gotoEditing = (UIButton *)[_headerView viewWithTag:90004];
    [btn_gotoEditing addTarget:self action:@selector(gotoPersonDetailViewController) forControlEvents:UIControlEventTouchUpInside];
    
    UIButton *btn_gotoOKList = (UIButton *)[_headerView viewWithTag:90006];
    [btn_gotoOKList addTarget:self action:@selector(gotoOkCouponList) forControlEvents:UIControlEventTouchUpInside];
    
    UIButton *btn_gotoCollection = (UIButton *)[_headerView viewWithTag:90007];
    [btn_gotoCollection addTarget:self action:@selector(gotoMyCollectionList) forControlEvents:UIControlEventTouchUpInside];
}

- (void)reloadData{
    NSString *_nick_name = [[NSString alloc]initWithFormat:@"%@",[[NSUserDefaults standardUserDefaults]objectForKey:@"Username"]];
    nick_name.text = _nick_name;
    UILabel *lb_currIntegral = (UILabel *)[_headerView viewWithTag:90005];
    UILabel *lb_currCash = (UILabel *)[_headerView viewWithTag:90008];
    
    if(dic_dataOfUser == nil){
        lb_currIntegral.text = @"0";
        lb_currCash.text = @"0";
    }
    else{
        
        lb_currIntegral.text = [NSString stringWithFormat:@"%d",[[dic_dataOfUser valueForKey:@"currIntegral"] intValue]];
        lb_currCash.text = [NSString stringWithFormat:@"%d",[[dic_dataOfUser valueForKey:@"currCash"] intValue] ];
    }
    NSString *string_temp1 = nil;
    if(dic_dataOfUser == nil){
        string_temp1 = @"所有订单";
    }else{
        string_temp1 = [NSString stringWithFormat:@"%d订单等待支付", [[dic_dataOfUser valueForKey:@"orderNum"] intValue]];
    }
    cell_orders.detailTextLabel.text = string_temp1;
    
    NSString *string_temp2 = nil;
    if(dic_dataOfUser == nil){
        string_temp2 = @"没有优惠券";
    }else{
        string_temp2 = [NSString stringWithFormat:@"未使用%d张", [[dic_dataOfUser valueForKey:@"couponNum"] intValue]];
    }
    cell_coupons.detailTextLabel.text = string_temp2;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (NSInteger) numberOfSectionsInTableView:(UITableView *)tableView{
    return 2;
}

- (NSInteger) tableView:(UITableView *)_tableView numberOfRowsInSection:(NSInteger)section{
    //return 3;
    switch (section) {
        case 0:{
            return 2;
            break;
        }
        case 1:{
            return 3;
            break;
        }
        default:
            return 0;
            break;
    }
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    //NSLog(@"PersonViewController==> return cells");
    UITableViewCell *cell = nil;
    switch (indexPath.section) {
        case 0:{
            switch(indexPath.row){
                case 0:
                    cell = [tableView dequeueReusableCellWithIdentifier:@"myOrderCell"];
                    if(cell == nil){
                        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"myOrderCell"];
                        cell.textLabel.text = @"我的订单";
                        
                        NSString *string_temp = nil;
                        if(dic_dataOfUser == nil){
                            string_temp = @"所有订单";
                        }else{
                            string_temp = [NSString stringWithFormat:@"%d订单等待支付", [[dic_dataOfUser valueForKey:@"orderNum"] intValue]];
                        }
                        cell.detailTextLabel.text = string_temp;
                        cell.detailTextLabel.font = [UIFont fontWithName:@"Arial" size:12.0];
                        cell.imageView.image = [UIImage imageNamed:@"订单@2x.png"];
                        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
                        cell_orders = cell;
                    }
                    break;
                case 2:
                    cell = [tableView dequeueReusableCellWithIdentifier:@"myWalletCell"];
                    if(cell == nil){
                        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"myWalletCell"];
                        cell.textLabel.text = @"我的钱包";
                        cell.detailTextLabel.text = @"余额：0元";
                        cell.imageView.image = [UIImage imageNamed:@"钱包@2x.png"];
                        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
                        
                    }
                    break;
                case 1:
                    cell = [tableView dequeueReusableCellWithIdentifier:@"mycouponCell"];
                    if(cell == nil){
                        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"mycouponCell"];
                        cell.textLabel.text = @"我的代金券";
                        
                        NSString *string_temp = nil;
                        if(dic_dataOfUser == nil){
                            string_temp = @"没有代金券";
                        }else{
                            string_temp = [NSString stringWithFormat:@"未使用%d张", [[dic_dataOfUser valueForKey:@"couponNum"] intValue]];
                        }
                        cell.detailTextLabel.text = string_temp;
                        cell.detailTextLabel.font = [UIFont fontWithName:@"Arial" size:12.0];
                        cell.imageView.image = [UIImage imageNamed:@"优惠券@2x.png"];
                        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
                        cell_coupons = cell;
                    }
                    break;
                default:
                    break;
            }
            break;
        }
        case 1:{
            switch (indexPath.row) {
                case 0:
                    cell = [tableView dequeueReusableCellWithIdentifier:@"gotoManagerCell"];                    if(cell == nil){
                        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"gotoPersonManagerCell"];
                        cell.textLabel.text = @"帐号管理";
                        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
                    }
                    break;
                case 1:
                    cell = [tableView dequeueReusableCellWithIdentifier:@"gotoSettingCell"];
                    if(cell == nil) {
                        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"gotoSettingCell"];
                        cell.textLabel.text = @"设置";
                        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
                    }
                    break;
                case 2:
                    cell = [tableView dequeueReusableCellWithIdentifier:@"gotoFeedBackCell"];
                    if(cell == nil) {
                        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"gotoFeedBackCell"];
                        cell.textLabel.text = @"反馈";
                        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
                    }
                    break;
                default:
                    break;
            }
            
            break;
        }
        case 2:{
            
            break;
        }
        case 3:{
            
            break;
        }
        default:
            break;
    }
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}

- (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    /*if(indexPath.row > 0){
        return 50;
    }else{
        return 200;
    }*/
    return 55;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    /*switch (indexPath.row) {
        case 1:
            NSLog(@"OrderList jump");
            [self gotoPersonOrderListController];
            break;
            
        case 2:
 
            if([[[NSUserDefaults standardUserDefaults]objectForKey:@"Mobile"]isEqualToString:@""] || [[[NSUserDefaults standardUserDefaults]objectForKey:@"Mobile"] length] != 11 || [[[NSUserDefaults standardUserDefaults]objectForKey:@"Mobile"] isEqualToString:@"10000000000"]){
                //NSLog(@"PhoneBind jump, %@", [[NSUserDefaults standardUserDefaults]objectForKey:P_MOBILE]);
                [self gotoPersonPhoneViewController];
            }else{
                UIAlertView *tempAlertView = [[UIAlertView alloc]initWithTitle:@"已绑定手机号：" message:[[NSUserDefaults standardUserDefaults]objectForKey:@"Mobile"] delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"解除绑定", nil];
                //UIAlertView *tempAlertView = [[UIAlertView alloc]initWithTitle:@"已绑定手机号：" message:[[NSUserDefaults standardUserDefaults]objectForKey:@"Mobile"] delegate:self cancelButtonTitle:@"好的" otherButtonTitles:nil, nil];
                tempAlertView.tag = 1110;
                [tempAlertView show];
            }
            NSLog(@"PhoneBind jump, %@", [[NSUserDefaults standardUserDefaults]objectForKey:P_MOBILENUMBER]);
            [self gotoPersonPhoneViewController];
            break;
        default:
            break;
    }*/
    switch (indexPath.section) {
        case 0:
            switch (indexPath.row) {
                case 0:
                    NSLog(@"PersonOrderList jump");
                    [self gotoPersonOrderListController];
                    break;
                case 1:
                    NSLog(@"PersonCouponList jump");
                    [self gotoPersonCouponListController];
                    break;
                case 2:
                    
                    break;
                default:
                    break;
            }
            break;
        case 1:
            switch (indexPath.row) {
                case 0:
                    NSLog(@"%s || PersonManagerController jump", __FUNCTION__);
                    [self gotoPersonManagerViewController];
                    break;
                case 1:
                    NSLog(@"%s || SettingViewController jump.",__FUNCTION__);
                    [self gotoSettingViewController];
                    break;
                case 2:
                    NSLog(@"%s || FeedbackView jump", __FUNCTION__);
                    [self gotoFeedBackViewController];
                    break;
                default:
                    break;
            }
            break;
        default:
            break;
    }
}

#pragma mark 添加手势
-(void)setGesture{
    /*添加点按手势*/
    //创建手势对象
    //UITapGestureRecognizer *tapGesture=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(singleTapAction:)];
    _imgTapGestureRecognizer = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(imgSingleTapAction:)];
    //设置手势属性
    _imgTapGestureRecognizer.numberOfTapsRequired=1;//设置点按次数，默认为1，注意在iOS中很少用双击操作
    _imgTapGestureRecognizer.numberOfTouchesRequired=1;//点按的手指数
    //添加手势到对象(注意，这里添加到了控制器视图中，而不是图片上，否则点击空白无法隐藏导航栏)
    //lbGenderTapGestureRecognizer.delegate = self;
    //[self.view addGestureRecognizer:defaultTapGestureRecognizer];
    //[imgView addGestureRecognizer:_imgTapGestureRecognizer];
}

#pragma mark - 手势操作
- (void)imgSingleTapAction:(UITapGestureRecognizer *)gesture{
    NSLog(@"==>>PersonViewController-->>imgSingleTapAction||action's been actived.");
    //在这里呼出下方菜单按钮项
    myActionSheet = [[UIActionSheet alloc]
                     initWithTitle:nil
                     delegate:self
                     cancelButtonTitle:@"取消"
                     destructiveButtonTitle:nil
                     otherButtonTitles: @"拍照", @"从相册获取",nil];
    
    [myActionSheet showInView:self.view];
}

- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{
    //呼出的菜单按钮点击后的响应
    if (buttonIndex == myActionSheet.cancelButtonIndex){
        NSLog(@"==>>PersonViewController-->>actionSheet||cancel button cliked.");
    }
    
    switch (buttonIndex){
        case 0:  //打开照相机拍照
            [self takePhoto];
            break;
            
        case 1:  //打开本地相册
            [self LocalPhoto];
            break;
    }
}

//开始拍照
-(void)takePhoto{
    UIImagePickerControllerSourceType sourceType = UIImagePickerControllerSourceTypeCamera;
    if ([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]){
        UIImagePickerController *picker = [[UIImagePickerController alloc] init];
        picker.delegate = self;
        //设置拍照后的图片可被编辑
        picker.allowsEditing = YES;
        picker.sourceType = sourceType;
        [picker release];
        [self presentModalViewController:picker animated:YES];
    }else{
        NSLog(@"模拟其中无法打开照相机,请在真机中使用");
    }
}

//打开本地相册
-(void)LocalPhoto{
    UIImagePickerController *picker = [[UIImagePickerController alloc] init];
    picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
    picker.delegate = self;
    //设置选择后的图片可被编辑
    picker.allowsEditing = YES;
    [self presentModalViewController:picker animated:YES];
    [picker release];
}

//当选择一张图片后进入这里
-(void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{
    NSString *type = [info objectForKey:UIImagePickerControllerMediaType];
    //当选择的类型是图片
    if ([type isEqualToString:@"public.image"]){
        //先把图片转成NSData
        UIImage* image = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
        NSData *data;
        if (UIImagePNGRepresentation(image) == nil){
            data = UIImageJPEGRepresentation(image, 1.0);
        }
        else{
            data = UIImagePNGRepresentation(image);
        }
        //图片保存的路径
        //这里将图片放在沙盒的documents文件夹中
        NSString * DocumentsPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
        //文件管理器
        NSFileManager *fileManager = [NSFileManager defaultManager];
        //把刚刚图片转换的data对象拷贝至沙盒中 并保存为image.png
        [fileManager createDirectoryAtPath:DocumentsPath withIntermediateDirectories:YES attributes:nil error:nil];
        [fileManager createFileAtPath:[DocumentsPath stringByAppendingString:@"/image.png"] contents:data attributes:nil];
        //得到选择后沙盒中图片的完整路径
        filePath = [[NSString alloc]initWithFormat:@"%@%@",DocumentsPath,  @"/image.png"];
        //关闭相册界面
        [picker dismissModalViewControllerAnimated:YES];
        //创建一个选择后图片的小图标放在下方
        //类似微薄选择图后的效果
        //UIImageView *smallimage = [[[UIImageView alloc] initWithFrame:CGRectMake(50, 120, 40, 40)] autorelease];
        //smallimage.image = image;
        //加在视图中
        imgView.image = image;
        //[self.view addSubview:smallimage];
    }
}

- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker{
    NSLog(@"您取消了选择图片");
    [picker dismissModalViewControllerAnimated:YES];
}

-(void)sendInfo{
    NSLog(@"图片的路径是：%@", filePath);
}

-(void)updateUsernameAfterUpdateSuccessed:(NSString *)username{
    nick_name.text = username;
}

- (void)getUserInfo{
    [[ProtocolManager shareInstance]getUserInfo:[ProtocolManager shareInstance].loginName target:self selector:@selector(getUserInfoCallBack:)];
}

- (void)getUserInfoCallBack:(NSDictionary *)dic{
    if(dic == nil){
        return;
    }
    NSLog(@"%s || dic:%@", __FUNCTION__, dic);
    if([Common valueForKey:@"respCode" dic:dic]){
        dic_dataOfUser = [[NSDictionary alloc]initWithDictionary:dic copyItems:YES];
        [self reloadData];
        [self.tableView reloadData];
    }
}

- (void)gotoMyCollectionList{
    CollectionMenuMainViewController *instance_topMenu = [[CollectionMenuMainViewController alloc]init];
    instance_topMenu.hidesBottomBarWhenPushed = YES;
    NSArray *array_title_temp = [NSArray arrayWithObjects:@"资讯",@"商家",@"商品",@"攻略", nil];
    NSArray *array_type_temp = [NSArray arrayWithObjects:@"NEWS", @"STORES",@"GOODS",@"STRATEGY", nil];
    instance_topMenu.string_title = @"我的收藏";
    instance_topMenu.array_title = [NSArray arrayWithArray:array_title_temp];
    instance_topMenu.isInstanceOfTableView = YES;
    NSMutableArray *array_temp = [[NSMutableArray alloc]init];
    for(int i = 0; i < 4; i++){
        CollectionListViewController *instance_collection = [[CollectionListViewController alloc]init];
        [instance_collection.view setFrame:[TransforController getRectOfView:self.view withHasNavigationBar:NO andHasBottomBar:YES]];
        instance_collection.instance_navigation = self.navigationCtrl;
        instance_collection.target_type = array_type_temp[i];
        [instance_collection getCommentList ];
        [array_temp addObject:instance_collection];
    }
    
    instance_topMenu.array_page = array_temp;
    [self.navigationCtrl pushViewController:instance_topMenu animated:YES];
}

- (void)gotoPersonManagerViewController{
    PersonManagerViewController *testViewController = [[PersonManagerViewController alloc]init];
    testViewController.hidesBottomBarWhenPushed = YES;
    [self.navigationCtrl pushViewController:testViewController animated:YES];
}

- (void)gotoPersonDetailViewController{
    PersonDetailViewController *personDetailController = [[PersonDetailViewController alloc]init];
    //personDetailController.person = _person;
    personDetailController.UpdateSuccessDelegate = self;
    personDetailController.hidesBottomBarWhenPushed = YES;
    [self.navigationCtrl pushViewController:personDetailController animated:YES];
    //[self presentViewController:personDetailController animated:YES completion:nil];
}

- (void)gotoPersonOrderListController{
    PersonOrderListViewController *personOrderListController = [[PersonOrderListViewController alloc]init];
    personOrderListController.hidesBottomBarWhenPushed = YES;
    [self.navigationCtrl pushViewController:personOrderListController animated:YES];
}

- (void)gotoPersonCouponListController{
    PersonCouponListViewController *personCouponListController = [[PersonCouponListViewController alloc]init];
    personCouponListController.hidesBottomBarWhenPushed = YES;
    [self.navigationCtrl pushViewController:personCouponListController animated:YES];
}

- (void)gotoOkCouponList{
    PersonOKListViewController *instance_personOkList = [[PersonOKListViewController alloc]init];
    instance_personOkList.hidesBottomBarWhenPushed = YES;
    [self.navigationCtrl pushViewController:instance_personOkList animated:YES];
}

- (void)gotoSettingViewController{
    EmptyViewController *emptyViewController = [[EmptyViewController alloc]initWithFrame:CGRectMake(0, 0, 320, 568)];
    SettingViewController *setting = [[SettingViewController alloc]initWithStyle:UITableViewStyleGrouped];
    [setting.view setFrame:CGRectMake(0, 0, 320, 523)];
//    setting.delegate = self;
//    setting.hidesBottomBarWhenPushed = YES;
    emptyViewController.hidesBottomBarWhenPushed = YES;
    [emptyViewController.view addSubview:setting.view];
    [emptyViewController.view addSubview:[TransforController shardeInstanceOfNavigationBarAndStatusBarCoverViewWithY:-65 andTitle:@"设置"]];
    setting.navigationCtrl = self.navigationCtrl;
    [self.navigationCtrl pushViewController:emptyViewController animated:YES];
}

- (void)gotoFeedBackViewController{
    FeedbackViewController *about = [[FeedbackViewController alloc] initWithNibName:@"FeedbackViewController" bundle:nil];
    about.hidesBottomBarWhenPushed = YES;
    [self.navigationCtrl pushViewController:about animated:YES];
}



/*
- (void)doDisBindingMobileAction:(NSDictionary *)dic{
    NSLog(@"==>>PersonViewController-->>doDisBindingMobileAction||dic:%@",dic);
    if(dic == nil){
        return;
    }
    if([[dic objectForKey:P_RESPCODE]isEqualToString:@"000"]){
        [[NSUserDefaults standardUserDefaults]setObject:@"10000000000" forKey:P_MOBILE];
        [[Common shareInstance] showAlertViewWithTitle:nil text:@"解绑成功！" dismissTime:1.5];
        [self changeMobilePhoneAfterUpdateSuccess:@"点击绑定"];
    }
}*/



@end
